<?php
class DefaultLoginTaobaoAction extends AdminAction
{
	public function __construct()
	{
		parent::__construct();
	}

	public function execute(){
		//写登录成功后写sessionKey的cookie
		C("LtCookie")->setCookie('forcelogin', 1);
		//写登录成功后跳转回的url的cookie
		C("LtCookie")->setCookie('redirect', $this->context->referer(C('LtUrl')->generate('Default','Index')), time() + 720);
		
		//跳转到淘宝登录页面
		$apiSetting = C('SettingService')->get('api_setting',true);
		
		$apis = explode(',', $apiSetting['taobao_api_appkey']);
		$this->redirect($apiSetting['taobao_api_userlogin'].$apis[0]);
	}
}
